x86: find a better location for the real-mode trampoline
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Jan 2013 10:35:11 +0000 (11:35 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Jan 2013 10:35:11 +0000 (11:35 +0100)
commit5e5e2d2a340238680100dd511bde3b5ca75c3b0d
tree873e78100270972eab518a2beef088c70a532a41
parent06b4c1765cdf7c9e93ad3cb859582a393d3eac4d
x86: find a better location for the real-mode trampoline

On some machines, the location at 0x40e does not point to the beginning
of the EBDA.  Rather, it points to the beginning of the BIOS-reserved
area of the EBDA, while the option ROMs place their data below that
segment.

For this reason, 0x413 is actually a better source than 0x40e to get
the location of the real-mode trampoline.  Xen was already using it
as a second source, and this patch keeps that working.  However, just
in case, let's also fetch the information from the multiboot structure,
where the boot loader should have placed it.  This way we don't
necessarily trust one of the BIOS or the multiboot loader more than
the other.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Retain the previous code, thus using the multiboot value only if it's
sane but lower than the BDA computed one. Also use the full 32-bit
mem_lower value and prefer MBI_MEMLIMITS over open coding it (requiring
a slight adjustment to multiboot.h to make its constants actually
usable in assembly code, which previously they were only meant to be).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/boot/head.S
xen/include/xen/multiboot.h